package free.play.controller;

import static org.springframework.web.bind.annotation.RequestMethod.POST;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

@Controller
public class ViewController {

  @RequestMapping(value = "/")
  public String index(HttpServletRequest request, Model model) {

    return "index";
  }

  @RequestMapping(value = "/form")
  public String form(HttpServletRequest request, Model model) {

    return "form";
  }

  @RequestMapping(value = "/submit", method = POST)
  @ResponseBody
  public String submit(HttpServletRequest request, Model model) {

    return "success";
  }

}
